package com.demo.component;

import com.demo.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Component
public class AComponent {

    //先设置属性
    @Resource
    private BComponent bComponent;

    @Autowired
    private Student student;


    //再进行初始化
    @PostConstruct
    public void postConstruct(){
        student.getId();
        System.out.println("执行了A的postConstruct");
    }



}
